0

Untitled3.ipynb

No Headings

The table of contents shows headings in notebooks and supported files.

Skip to Main
Jupyter

Untitled3

Last Checkpoint: 53 seconds ago
  • File
  • Edit
  • View
  • Run
  • Kernel
  • Settings
  • Help
JupyterLab
Python 3 (ipykernel)
Kernel status: Idle
image/svg+xml
    [2]:
    Selection deleted
    import numpy as np
    [4]:
    ones_arr=np.ones((5,5),dtype=int)
    ones_arr
    [4]:
    array([[1, 1, 1, 1, 1],
           [1, 1, 1, 1, 1],
           [1, 1, 1, 1, 1],
           [1, 1, 1, 1, 1],
           [1, 1, 1, 1, 1]])
    [5]:
    ones_arr * 255
    [5]:
    array([[255, 255, 255, 255, 255],
           [255, 255, 255, 255, 255],
           [255, 255, 255, 255, 255],
           [255, 255, 255, 255, 255],
           [255, 255, 255, 255, 255]])
    [78]:
    import matplotlib.pyplot as plt
    [8]:
    matplotlib inline #all graph should keep inside the line
    [9]:
    from PIL import Image #python image library
    [28]:
    Selection deleted
    horse_img=Image.open(r"C:\Anitha\image\pexels-wildlittlethingsphoto-1996333.jpg")
    horse_img
    [28]:
    [80]:
    type(horse_img)
    [80]:
    PIL.JpegImagePlugin.JpegImageFile
    [41]:
    array([[[15, 17, 29],
            [15, 17, 29],
            [15, 17, 29],
            ...,
            [25, 37, 35],
            [19, 34, 31],
            [14, 30, 27]],
    
           [[15, 17, 29],
            [15, 17, 29],
            [15, 17, 29],
            ...,
            [26, 38, 36],
            [22, 37, 34],
            [20, 36, 33]],
    
           [[15, 17, 29],
            [15, 17, 29],
            [15, 17, 29],
            ...,
            [28, 40, 38],
            [25, 40, 37],
            [24, 40, 37]],
    
           ...,
    
           [[49, 50, 44],
            [40, 41, 35],
            [35, 35, 27],
            ...,
            [14, 30, 29],
            [13, 25, 25],
            [12, 22, 23]],
    
           [[45, 50, 44],
            [38, 43, 37],
            [31, 36, 30],
            ...,
            [11, 25, 25],
            [12, 24, 24],
            [16, 26, 27]],
    
           [[31, 41, 33],
            [31, 41, 33],
            [32, 39, 32],
            ...,
            [14, 26, 26],
            [16, 26, 27],
            [23, 31, 33]]], dtype=uint8)
    [81]:
    numpy.ndarray
    [42]:
    <matplotlib.image.AxesImage at 0x1436e1614c0>
    [82]:
    (2334, 3502, 3)
    [44]:
    PIL.JpegImagePlugin.JpegImageFile
    [83]:
    array([[[15, 17, 29],
            [15, 17, 29],
            [15, 17, 29],
            ...,
            [25, 37, 35],
            [19, 34, 31],
            [14, 30, 27]],
    
           [[15, 17, 29],
            [15, 17, 29],
            [15, 17, 29],
            ...,
            [26, 38, 36],
            [22, 37, 34],
            [20, 36, 33]],
    
           [[15, 17, 29],
            [15, 17, 29],
            [15, 17, 29],
            ...,
            [28, 40, 38],
            [25, 40, 37],
            [24, 40, 37]],
    
           ...,
    
           [[49, 50, 44],
            [40, 41, 35],
            [35, 35, 27],
            ...,
            [14, 30, 29],
            [13, 25, 25],
            [12, 22, 23]],
    
           [[45, 50, 44],
            [38, 43, 37],
            [31, 36, 30],
            ...,
            [11, 25, 25],
            [12, 24, 24],
            [16, 26, 27]],
    
           [[31, 41, 33],
            [31, 41, 33],
            [32, 39, 32],
            ...,
            [14, 26, 26],
            [16, 26, 27],
            [23, 31, 33]]], dtype=uint8)
    [84]:
    array([[[ True,  True,  True],
            [ True,  True,  True],
            [ True,  True,  True],
            ...,
            [ True,  True,  True],
            [ True,  True,  True],
            [ True,  True,  True]],
    
           [[ True,  True,  True],
            [ True,  True,  True],
            [ True,  True,  True],
            ...,
            [ True,  True,  True],
            [ True,  True,  True],
            [ True,  True,  True]],
    
           [[ True,  True,  True],
            [ True,  True,  True],
            [ True,  True,  True],
            ...,
            [ True,  True,  True],
            [ True,  True,  True],
            [ True,  True,  True]],
    
           ...,
    
           [[ True,  True,  True],
            [ True,  True,  True],
            [ True,  True,  True],
            ...,
            [ True,  True,  True],
            [ True,  True,  True],
            [ True,  True,  True]],
    
           [[ True,  True,  True],
            [ True,  True,  True],
            [ True,  True,  True],
            ...,
            [ True,  True,  True],
            [ True,  True,  True],
            [ True,  True,  True]],
    
           [[ True,  True,  True],
            [ True,  True,  True],
            [ True,  True,  True],
            ...,
            [ True,  True,  True],
            [ True,  True,  True],
            [ True,  True,  True]]])
    [90]:
    <matplotlib.image.AxesImage at 0x1436de2dc40>
    [92]:
    <matplotlib.image.AxesImage at 0x1436e160620>
    [94]:
    array([[15, 15, 15, ..., 25, 19, 14],
           [15, 15, 15, ..., 26, 22, 20],
           [15, 15, 15, ..., 28, 25, 24],
           ...,
           [49, 40, 35, ..., 14, 13, 12],
           [45, 38, 31, ..., 11, 12, 16],
           [31, 31, 32, ..., 14, 16, 23]], dtype=uint8)
    [76]:
    <matplotlib.image.AxesImage at 0x1436e259970>
    [95]:
    <matplotlib.image.AxesImage at 0x1436df66780>
    [99]:
    <matplotlib.image.AxesImage at 0x1436fb95dc0>
    [101]:
    <matplotlib.image.AxesImage at 0x1436fb964e0>
    [104]:
    array([[1, 1, 1, 1, 1],
           [1, 1, 1, 1, 1],
           [1, 1, 1, 1, 1],
           [1, 1, 1, 1, 1],
           [1, 1, 1, 1, 1]])
    [105]:
    array([[255, 255, 255, 255, 255],
           [255, 255, 255, 255, 255],
           [255, 255, 255, 255, 255],
           [255, 255, 255, 255, 255],
           [255, 255, 255, 255, 255]])
    [108]:
    [109]:
    PIL.PngImagePlugin.PngImageFile
    [110]:
    array([[[ 12,  11,   4, 255],
            [ 12,  11,   4, 255],
            [ 12,  11,   4, 255],
            ...,
            [ 34,  34,  34, 255],
            [ 34,  34,  34, 255],
            [ 34,  34,  34, 255]],
    
           [[ 12,  11,   4, 255],
            [ 12,  11,   4, 255],
            [ 12,  11,   4, 255],
            ...,
            [ 34,  34,  34, 255],
            [ 34,  34,  34, 255],
            [ 34,  34,  34, 255]],
    
           [[ 12,  11,   4, 255],
            [ 12,  11,   4, 255],
            [ 12,  11,   4, 255],
            ...,
            [ 34,  34,  34, 255],
            [ 34,  34,  34, 255],
            [ 34,  34,  34, 255]],
    
           ...,
    
           [[ 10,  16,  19, 255],
            [ 11,  16,  21, 255],
            [ 13,  17,  23, 255],
            ...,
            [ 14,  14,  14, 255],
            [ 14,  14,  14, 255],
            [ 14,  14,  14, 255]],
    
           [[ 10,  16,  19, 255],
            [ 11,  16,  21, 255],
            [ 13,  17,  23, 255],
            ...,
            [ 13,  13,  13, 255],
            [ 13,  13,  13, 255],
            [ 13,  13,  13, 255]],
    
           [[ 10,  16,  19, 255],
            [ 11,  16,  21, 255],
            [ 13,  17,  23, 255],
            ...,
            [ 12,  12,  12, 255],
            [ 12,  12,  12, 255],
            [ 12,  12,  12, 255]]], dtype=uint8)
    [111]:
    numpy.ndarray
    [112]:
    <matplotlib.image.AxesImage at 0x1436fef8950>
    [116]:
    (624, 1207, 4)
    [118]:
    array([[[ 12,  11,   4, 255],
            [ 12,  11,   4, 255],
            [ 12,  11,   4, 255],
            ...,
            [ 34,  34,  34, 255],
            [ 34,  34,  34, 255],
            [ 34,  34,  34, 255]],
    
           [[ 12,  11,   4, 255],
            [ 12,  11,   4, 255],
            [ 12,  11,   4, 255],
            ...,
            [ 34,  34,  34, 255],
            [ 34,  34,  34, 255],
            [ 34,  34,  34, 255]],
    
           [[ 12,  11,   4, 255],
            [ 12,  11,   4, 255],
            [ 12,  11,   4, 255],
            ...,
            [ 34,  34,  34, 255],
            [ 34,  34,  34, 255],
            [ 34,  34,  34, 255]],
    
           ...,
    
           [[ 10,  16,  19, 255],
            [ 11,  16,  21, 255],
            [ 13,  17,  23, 255],
            ...,
            [ 14,  14,  14, 255],
            [ 14,  14,  14, 255],
            [ 14,  14,  14, 255]],
    
           [[ 10,  16,  19, 255],
            [ 11,  16,  21, 255],
            [ 13,  17,  23, 255],
            ...,
            [ 13,  13,  13, 255],
            [ 13,  13,  13, 255],
            [ 13,  13,  13, 255]],
    
           [[ 10,  16,  19, 255],
            [ 11,  16,  21, 255],
            [ 13,  17,  23, 255],
            ...,
            [ 12,  12,  12, 255],
            [ 12,  12,  12, 255],
            [ 12,  12,  12, 255]]], dtype=uint8)
    [119]:
    array([[[ True,  True,  True,  True],
            [ True,  True,  True,  True],
            [ True,  True,  True,  True],
            ...,
            [ True,  True,  True,  True],
            [ True,  True,  True,  True],
            [ True,  True,  True,  True]],
    
           [[ True,  True,  True,  True],
            [ True,  True,  True,  True],
            [ True,  True,  True,  True],
            ...,
            [ True,  True,  True,  True],
            [ True,  True,  True,  True],
            [ True,  True,  True,  True]],
    
           [[ True,  True,  True,  True],
            [ True,  True,  True,  True],
            [ True,  True,  True,  True],
            ...,
            [ True,  True,  True,  True],
            [ True,  True,  True,  True],
            [ True,  True,  True,  True]],
    
           ...,
    
           [[ True,  True,  True,  True],
            [ True,  True,  True,  True],
            [ True,  True,  True,  True],
            ...,
            [ True,  True,  True,  True],
            [ True,  True,  True,  True],
            [ True,  True,  True,  True]],
    
           [[ True,  True,  True,  True],
            [ True,  True,  True,  True],
            [ True,  True,  True,  True],
            ...,
            [ True,  True,  True,  True],
            [ True,  True,  True,  True],
            [ True,  True,  True,  True]],
    
           [[ True,  True,  True,  True],
            [ True,  True,  True,  True],
            [ True,  True,  True,  True],
            ...,
            [ True,  True,  True,  True],
            [ True,  True,  True,  True],
            [ True,  True,  True,  True]]])
    [120]:
    <matplotlib.image.AxesImage at 0x1436e2a2f30>
    [123]:
    (624, 1207, 4)
    [124]:
    <matplotlib.image.AxesImage at 0x1436ffae540>
    [126]:
    array([[12, 12, 12, ..., 34, 34, 34],
           [12, 12, 12, ..., 34, 34, 34],
           [12, 12, 12, ..., 34, 34, 34],
           ...,
           [10, 11, 13, ..., 14, 14, 14],
           [10, 11, 13, ..., 13, 13, 13],
           [10, 11, 13, ..., 12, 12, 12]], dtype=uint8)
    [131]:
    <matplotlib.image.AxesImage at 0x14305e35b50>
    [145]:
    <matplotlib.image.AxesImage at 0x14305639640>
    [139]:
    plt.imshow(pic_red[:,:,2], cmap='YlGn')
    [139]:
    <matplotlib.image.AxesImage at 0x143063d6780>
    [143]:
    <matplotlib.image.AxesImage at 0x1430645d580>

    -

    Variables

    Callstack

      Breakpoints

      Source

      9
      1

      Kernel Sources

      Common Tools
      No metadata.
      Advanced Tools
      No metadata.
      • fsavefigfunction
      • fscafunction
      • fscatterfunction
      • fscifunction
      • fsemilogxfunction
      • fsemilogyfunction
      • fset_cmapfunction
      • fset_loglevelfunction
      • fsetpfunction
      • fshowfunction
      • fspecgramfunction
      • fspringfunction
      • fspyfunction
      • fstackplotfunction
      • fstairsfunction
      • fstemfunction
      • fstepfunction
      • fstreamplotfunction
      • mstylemodule
      • fsubplotfunction
      • fsubplot_mosaicfunction
      • fsubplot_toolfunction
      • fsubplot2gridfunction
      • fsubplotsfunction
      • fsubplots_adjustfunction
      • fsummerfunction
      • fsuptitlefunction
      • fswitch_backendfunction
      • msysmodule
      Alt+[
      Alt+]
      Alt+End
      • Console
      • Change Kernel…
      • Clear Console Cells
      • Close and Shut Down…
      • Insert Line Break
      • Interrupt Kernel
      • New Console
      • Restart Kernel…
      • Run Cell (forced)
      • Run Cell (unforced)
      • Show All Kernel Activity
      • Debugger
      • Breakpoints on exception
      • Evaluate Code
        Evaluate Code
      • Next
        Next
        F10
      • Pause
        Pause
        F9
      • Step In
        Step In
        F11
      • Step Out
        Step Out
        Shift+F11
      • Terminate
        Terminate
        Shift+F9
      • Display Languages
      • English
        English
      • File Operations
      • Autosave Documents
      • Download
        Download the file to your computer
      • Reload Notebook from Disk
        Reload contents from disk
      • Revert Notebook to Checkpoint…
        Revert contents to previous checkpoint
      • Save Notebook
        Save and create checkpoint
        Ctrl+S
      • Save Notebook As…
        Save with new path
        Ctrl+Shift+S
      • Trust HTML File
        Whether the HTML file is trusted. Trusting the file allows scripts to run in it, which may result in security risks. Only enable for files you trust.
      • Help
      • About Jupyter Notebook
      • Jupyter Reference
      • JupyterLab FAQ
      • JupyterLab Reference
      • Launch Jupyter Notebook File Browser
      • Markdown Reference
      • Show Keyboard Shortcuts…
        Show relevant keyboard shortcuts for the current active widget
        Ctrl+Shift+H
      • Image Viewer
      • Flip image horizontally
        H
      • Flip image vertically
        V
      • Invert Colors
        I
      • Reset Image
        0
      • Rotate Clockwise
        ]
      • Rotate Counterclockwise
        [
      • Zoom In
        =
      • Zoom Out
        -
      • Kernel Operations
      • Shut Down All Kernels…
      • Main Area
      • Close All Other Tabs
      • Close Tab
        Alt+W
      • Close Tabs to Right
      • End Search
        Esc
      • Find Next
        Ctrl+G
      • Find Previous
        Ctrl+Shift+G
      • Find…
        Ctrl+F
      • Log Out
        Log out of Jupyter Notebook
      • Search in Selection
        Alt+L
      • Shut Down
        Shut down Jupyter Notebook
      • Mode
      • Toggle Zen Mode
      • Notebook Cell Operations
      • Change to Code Cell Type
        Y
      • Change to Heading 1
        1
      • Change to Heading 2
        2
      • Change to Heading 3
        3
      • Change to Heading 4
        4
      • Change to Heading 5
        5
      • Change to Heading 6
        6
      • Change to Markdown Cell Type
        M
      • Change to Raw Cell Type
        R
      • Clear Cell Output
        Clear outputs for the selected cells
      • Collapse All Code
      • Collapse All Outputs
      • Collapse Selected Code
      • Collapse Selected Outputs
      • Copy Cell
        Copy this cell
        C
      • Cut Cell
        Cut this cell
        X
      • Delete Cell
        Delete this cell
        D, D
      • Disable Scrolling for Outputs
      • Enable Scrolling for Outputs
      • Expand All Code
      • Expand All Outputs
      • Expand Selected Code
      • Expand Selected Outputs
      • Extend Selection Above
        Shift+K
      • Extend Selection Below
        Shift+J
      • Extend Selection to Bottom
        Shift+End
      • Extend Selection to Top
        Shift+Home
      • Insert Cell Above
        Insert a cell above
        A
      • Insert Cell Below
        Insert a cell below
        B
      • Insert Heading Above Current Heading
        Shift+A
      • Insert Heading Below Current Heading
        Shift+B
      • Merge Cell Above
        Ctrl+Backspace
      • Merge Cell Below
        Ctrl+Shift+M
      • Merge Selected Cells
        Shift+M
      • Move Cell Down
        Move this cell down
        Ctrl+Shift+Down
      • Move Cell Up
        Move this cell up
        Ctrl+Shift+Up
      • Paste Cell Above
        Paste this cell from the clipboard
      • Paste Cell and Replace
      • Paste Cell Below
        Paste this cell from the clipboard
        V
      • Redo Cell Operation
        Shift+Z
      • Render Side-by-Side
        Shift+R
      • Run Selected Cell
        Run this cell and advance
        Shift+Enter
      • Run Selected Cell and Do not Advance
        Ctrl+Enter
      • Run Selected Cell and Insert Below
        Alt+Enter
      • Run Selected Text or Current Line in Console
      • Select Cell Above
        K
      • Select Cell Below
        J
      • Select Heading Above or Collapse Heading
        Left
      • Select Heading Below or Expand Heading
        Right
      • Set side-by-side ratio
      • Split Cell
        Ctrl+Shift+-
      • Undo Cell Operation
        Z
      • Notebook Operations
      • Access Next Kernel History Entry
        Alt+Down
      • Access Previous Kernel History Entry
        Alt+Up
      • Change Kernel…
      • Clear Outputs of All Cells
        Clear all outputs of all cells
      • Close and Shut Down Notebook…
      • Collapse All Headings
        Ctrl+Shift+Left
      • Deselect All Cells
      • Edit Notebook Metadata
      • Enter Command Mode
        Ctrl+M
      • Enter Edit Mode
        Enter
      • Expand All Headings
        Ctrl+Shift+Right
      • Interrupt Kernel
        Interrupt the kernel
      • New Console for Notebook
      • New Notebook
        Create a new notebook
      • Open with Panel in New Browser Tab
      • Preview Notebook with Panel
      • Reconnect to Kernel
      • Render All Markdown Cells
      • Restart Kernel and Clear Outputs of All Cells…
        Restart the kernel and clear all outputs of all cells
      • Restart Kernel and Debug…
        Restart Kernel and Debug…
      • Restart Kernel and Run All Cells…
        Restart the kernel and run all cells
      • Restart Kernel and Run up to Selected Cell…
      • Restart Kernel…
        Restart the kernel
      • Run All Above Selected Cell
      • Run All Cells
        Run all cells
      • Run Selected Cell and All Below
      • Save and Export Notebook: Asciidoc
      • Save and Export Notebook: Executable Script
      • Save and Export Notebook: HTML
      • Save and Export Notebook: LaTeX
      • Save and Export Notebook: Markdown
      • Save and Export Notebook: PDF
      • Save and Export Notebook: Qtpdf
      • Save and Export Notebook: Qtpng
      • Save and Export Notebook: ReStructured Text
      • Save and Export Notebook: Reveal.js Slides
      • Save and Export Notebook: Webpdf
      • Select All Cells
        Ctrl+A
      • Show Line Numbers
      • Toggle Collapse Notebook Heading
      • Trust Notebook
      • Other
      • Open in JupyterLab
        JupyterLab
      • Plugin Manager
      • Advanced Plugin Manager
      • Terminal
      • Decrease Terminal Font Size
      • Increase Terminal Font Size
      • New Terminal
        Start a new terminal session
      • Refresh Terminal
        Refresh the current terminal session
      • Use Terminal Theme: Dark
        Set the terminal theme
      • Use Terminal Theme: Inherit
        Set the terminal theme
      • Use Terminal Theme: Light
        Set the terminal theme
      • Text Editor
      • Decrease Font Size
      • Increase Font Size
      • New Markdown File
        Create a new markdown file
      • New Python File
        Create a new Python file
      • New Text File
        Create a new text file
      • Spaces: 1
      • Spaces: 2
      • Spaces: 4
      • Spaces: 4
      • Spaces: 8
      • Theme
      • Decrease Code Font Size
      • Decrease Content Font Size
      • Decrease UI Font Size
      • Increase Code Font Size
      • Increase Content Font Size
      • Increase UI Font Size
      • Set Preferred Dark Theme: JupyterLab Dark
      • Set Preferred Dark Theme: JupyterLab Dark High Contrast
      • Set Preferred Dark Theme: JupyterLab Light
      • Set Preferred Light Theme: JupyterLab Dark
      • Set Preferred Light Theme: JupyterLab Dark High Contrast
      • Set Preferred Light Theme: JupyterLab Light
      • Synchronize Styling Theme with System Settings
      • Theme Scrollbars
      • Use Theme: JupyterLab Dark
      • Use Theme: JupyterLab Dark High Contrast
      • Use Theme: JupyterLab Light
      • View
      • File Browser
      • Open JupyterLab
      • Show Debugger
        Show Show Debugger in the right sidebar
      • Show Header
      • Show Notebook Tools
        Show Show Notebook Tools in the right sidebar
      • Show Table of Contents
        Show Show Table of Contents in the left sidebar